package com.hfi.ood.litejunit.v2.biz.calculator;

import com.hfi.ood.litejunit.v2.framework.TestCase;

/**
 * @author ChangLiang
 * @date 2020/5/26
 */
public class CalculatorTest extends TestCase {


    public CalculatorTest(String name) {
        super(name);
    }

    Calculator calculator;

    @Override
    public void setUp() {
        calculator = new Calculator();
    }

    @Override
    public void tearDown() {
        calculator = null;
    }

    public void testAdd() {
        calculator.add(10);
        assertEquals(10,calculator.getResult());
    }

    public void testSubtract() {
        calculator.add(10);
        calculator.subtract(5);
        assertEquals(4,calculator.getResult());
    }
}
